<%-- 
    Document   : TesteComJavaScript
    Created on : 01/11/2013, 20:23:39
    Author     : Mike
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <!-- Assim se faz a referencia-->
        <script type="text/javascript" src="ValidaData.js"></script>
        <script type="text/javascript" src="MascaraCPF.js"></script>
        
        <title>Testando campo com data</title>
        
    </head>
    <body>
        <h1>Mascara Data</h1>
        <!-- assim deve ser o input com as propriedades OnKeyDown e OnBlur -->
        <input value="" type="text" size="10" maxlength="10" onKeyDown="return(FormataData(this,event));" name="data1"/> <!-- onBlur="javascript:if(!ConsisteData(this)){alert('Data inválida')};" -->
         <h1>Mascara CPF</h1>
         <!-- Onkeypress - chama a função e determina a mascara -->
         <input value="" type="text" size="14" maxlength="14" Onkeypress="formatar(this,'###.###.###-##');" name="data2"/> 
    </body>
</html>
